/*
 * @Author: wang_changtan 2196064304@qq.com
 * @Date: 2024-02-23 10:39:33
 * @LastEditors: wang_changtan 2196064304@qq.com
 * @LastEditTime: 2024-02-23 10:53:42
 * @FilePath: /web_music_app_vue3_vite_ts/src/utils/index.ts
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
/**
 * 数字转换成万
 * @param num 
 */
export function dealNumber(num: number) {
    let str = `${num}`;
    if(str.length > 5 && str.length < 9){
        let n = (num / Math.pow(10,4)).toFixed(0);
        str = `${n}万`;
    }else if(str.length > 8){
        let y = (num / Math.pow(10,8)).toFixed(0);
        str = `${y}亿`;
    }
    return str

}